// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently,
// but are changed infrequently

#pragma once

#include "NVAPI/nvapi.h"
#include "Functions.h"
#include "NvApi Exception.h"
#include "Element Collection.h"

#define SAFE_DELETE(p)	{ if( (p) != NULL){ (p) = NULL; delete (p); } }
#define SAFE_FREE_MANY( void_ptrs )\
{\
	int count = sizeof( void_ptrs ) / sizeof( void* );\
	for( int x = 0; x < count; x++ )\
	{\
		if( void_ptrs[ x ] != NULL )\
			free( (void*)void_ptrs[ x ] );\
	}\
}

#define ThrowOnError( result )\
{\
	if( result != NVAPI_OK )\
		throw gcnew NvApiException( "{0}", (Status)result );\
}

#define NULL 0

using namespace System;